package com.bvgol.examples.springboot.args.controller;/**
 * @Classname SleepController
 * @Description TODO
 * @Date 2021/3/30 16:38
 * @Created by GUOCHEN
 */

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.concurrent.TimeUnit;

/**
 * @program: my-spring-completely
 * @description:
 * @author: GUOCHEN
 * @create: 2021/03/30 16:38
 */
@Slf4j
@RestController
@RequestMapping("/sleep")
public class SleepController {
    @SneakyThrows
    @GetMapping("/sleepppp")
    public Object sleepppp(@RequestParam() String str) {
        TimeUnit.SECONDS.sleep(10);
        String format = LocalDateTime.now().format(DateTimeFormatter.BASIC_ISO_DATE);
        return str + "--->" + format;
    }
}
